﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CApCableCompoundFocusableControl
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System;
using System.Collections.Generic;
using System.Linq;


namespace DnProcessSimulateCommands;

public class CApCableCompoundFocusableControl : ICApCableFocusableControl
{
  private readonly IEnumerable<ICApCableFocusableControl> m_focusableControls;

  public CApCableCompoundFocusableControl(
    IEnumerable<ICApCableFocusableControl> focusableControls)
  {
    this.m_focusableControls = focusableControls ?? throw new ArgumentNullException(nameof (focusableControls));
    if (focusableControls.Contains<ICApCableFocusableControl>((ICApCableFocusableControl) null))
      throw new ArgumentNullException("focusableControl");
  }

  public bool SetFocus()
  {
    bool flag = false;
    IEnumerator<ICApCableFocusableControl> enumerator = this.m_focusableControls.GetEnumerator();
    while (!flag && enumerator.MoveNext())
      flag = enumerator.Current.SetFocus();
    return flag;
  }
}
